ccR.Add_Rotation(
	1, -- Player Specialization
	"CC_Hunter_BM_Solo", -- Function name
	"Levelling from 90-100", -- Description
	"CC_Hunter_BM_Talents", -- Talents button frame
	"CC_Hunter_BM_Abilities", -- Abilities button frame
	"CC_Hunter_BM_Features", -- Features button frame
	"CC_Hunter_BM_Setup" -- Setup button frame
)
function CC_Hunter_BM_Solo()
	if ccR.Player.Is.ChannelingSpell(BARRAGE) then return end

	-- Features.lua
	if ccR.Player.Is.InCombat() then
		if ccR.Var("Masters_Call") then ccR.Hunter.Masters_Call() end
		if ccR.Var("Counter_Shot") then ccR.Hunter.Counter_Shot() end
		if ccR.Var("Kill_Shot") then ccR.Hunter.Kill_Shot() end
		if ccR.Var("Mend_Pet") then ccR.Hunter.Mend_Pet() end
		if ccR.Var("Misdirection") then ccR.Hunter.Misdirection() end
	end

	if ccR.Target.Is.Attackable() then
		if ccR.Var("Pet_Attack_Target") then if ccR.Unit.TargetName("pet") ~= ccR.Target.Name() then PetAttack("target") end end
		if ccR.Player.IsFacing("target") then
			ccR.Start_Attack()
			if ccR.Player.Is.InCombat() 
			and not ccR.Player.Is.CastingOrChanneling()
			then
				-- Bestial Wrath
				if ccR.Var("Bestial_Wrath")
				and (not ccR.Var("Bestial_Wrath_OnBoss") or (ccR.Var("Bestial_Wrath_Style") and (ccR.Target.Is.Boss() or ccR.Player.Is.Solo())))
				and ccR.Spell.Is.Ready(BESTIAL_WRATH)
				and not ccR.Player.Has.Buff(BESTIAL_WRATH)
				then
					ccR.Cast.Spell(BESTIAL_WRATH)
				end
				if ccR.Var("Dire_Beast") then ccR.Hunter.Talent.Dire_Beast() end
				if ccR.Var("Binding_Shot") then ccR.Hunter.Talent.Binding_Shot(ccR.Var("Binding_Shot_Count")) end
				if ccR.Var("Intimidation") then ccR.Hunter.Talent.Intimidation() end
				if ccR.Var("Stampede") then ccR.Hunter.Talent.Stampede() end
				if ccR.Var("Exhilaration") then ccR.Hunter.Talent.Exhilaration(ccR.Var("Exhilaration_Health")) end
			end
			if ccR.Spell.Is.Ready(FOCUS_FIRE) and ccR.Player.Buff.Stacks(FRENZY) == 5 then ccR.Cast.Spell(FOCUS_FIRE) end
			if ccR.Pet.IsAlive() and ccR.Pet.Count(8) > 0 and ccR.Pet.Distance("target") < 8 and ccR.Spell.CanAttack(KILL_COMMAND) then ccR.Cast.Spell(KILL_COMMAND) end
			-- AoE
			if (ccR.Var("AutoAoE") and not ccR.Target.Is.Boss() and ccR.Target.Count(10) >= ccR.Var("AoECount")) or ccR.Settings("Manual_AoE") then
				if ccR.Spell.Is.Ready(TRAP_LAUNCHER) and not ccR.Player.Has.Buff(TRAP_LAUNCHER) then ccR.Cast.Spell(TRAP_LAUNCHER) end
				if ccR.Spell.Is.Ready(EXPLOSIVE_TRAP) and ccR.Player.Has.Buff(TRAP_LAUNCHER) then ccR.Cast.AoE(EXPLOSIVE_TRAP, "target", 40, 10) end
				if ccR.Var("Barrage") then if ccR.Player.Is.InDungeon() or ccR.Player.Is.InRaid() then if (ccR.Var("Barrage_OnBoss") and ccR.Target.Is.Boss()) or not ccR.Var("Barrage_OnBoss") then ccR.Hunter.Talent.Barrage() end else ccR.Hunter.Talent.Barrage()	end	end
				if ccR.Player.Has.Talent(POWERSHOT) then ccR.Hunter.Talent.Powershot() end
				if ccR.Player.Has.Talent(GLAIVE_TOSS) then ccR.Hunter.Talent.Glaive_Toss() end
				if ccR.Spell.CanAttack(MULTI_SHOT) then
					local vOnCD = 0
					local vTalentCount = 0
					if ccR.Player.Has.Talent(A_MURDER_OF_CROWS) then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(A_MURDER_OF_CROWS) > 1.5 then vOnCD = vOnCD + 1 end end
					if ccR.Player.Has.Talent(GLAIVE_TOSS) then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(GLAIVE_TOSS) > 1.5 then vOnCD = vOnCD + 1 end end
					if ccR.Player.Has.Talent(POWERSHOT) then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(POWERSHOT) > 1.5 then vOnCD = vOnCD + 1 end end
					if ccR.Player.Has.Talent(BARRAGE) and ccR.Var("Barrage") and (not ccR.Var("Barrage_OnBoss") or (ccR.Var("Barrage_OnBoss") and ((not ccR.Player.Is.InRaid() and not ccR.Player.Is.InDungeon()) or ((ccR.Player.Is.InRaid() or ccR.Player.Is.InDungeon) and ccR.Target.Is.Boss()))))	then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(BARRAGE) > 1.5 then vOnCD = vOnCD + 1 end end
					if ccR.Pet.IsAlive() and ccR.Pet.Count(8) > 0 and ccR.Pet.Distance("target") < 8 then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(KILL_COMMAND) > 1.5 then vOnCD = vOnCD + 1 end end
					if vOnCD >= vTalentCount then ccR.Cast.Attack(MULTI_SHOT) end
				end
				if ccR.Player.Has.Talent(FOCUSING_SHOT) then if ccR.Spell.CanAttack(FOCUSING_SHOT) and not ccR.Player.Is.Moving() then ccR.Cast.Attack(FOCUSING_SHOT) end else if ccR.Spell.CanAttack(COBRA_SHOT) then ccR.Cast.Attack(COBRA_SHOT) end end
				return
			end
			-- Single Target, < AoE
			if ccR.Player.Has.Talent(A_MURDER_OF_CROWS) then ccR.Hunter.Talent.A_Murder_of_Crows() end
			if ccR.Player.Has.Talent(GLAIVE_TOSS) then ccR.Hunter.Talent.Glaive_Toss() end
			if ccR.Player.Has.Talent(POWERSHOT) then ccR.Hunter.Talent.Powershot() end
			if ccR.Var("Barrage") then if ccR.Player.Is.InDungeon() or ccR.Player.Is.InRaid() then if (ccR.Var("Barrage_OnBoss") and ccR.Target.Is.Boss()) or not ccR.Var("Barrage_OnBoss") then ccR.Hunter.Talent.Barrage() end else ccR.Hunter.Talent.Barrage()	end	end
			if ccR.Spell.CanAttack(ARCANE_SHOT) then
				local vOnCD = 0
				local vTalentCount = 0
				if ccR.Player.Has.Talent(A_MURDER_OF_CROWS) then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(A_MURDER_OF_CROWS) > 1.5 then vOnCD = vOnCD + 1 end end
				if ccR.Player.Has.Talent(GLAIVE_TOSS) then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(GLAIVE_TOSS) > 1.5 then vOnCD = vOnCD + 1 end end
				if ccR.Player.Has.Talent(POWERSHOT) then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(POWERSHOT) > 1.5 then vOnCD = vOnCD + 1 end end
				if ccR.Player.Has.Talent(BARRAGE) and ccR.Var("Barrage") and (not ccR.Var("Barrage_OnBoss") or (ccR.Var("Barrage_OnBoss") and ((not ccR.Player.Is.InRaid() and not ccR.Player.Is.InDungeon()) or ((ccR.Player.Is.InRaid() or ccR.Player.Is.InDungeon) and ccR.Target.Is.Boss()))))	then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(BARRAGE) > 1.5 then vOnCD = vOnCD + 1 end end
				if ccR.Pet.IsAlive() and ccR.Pet.Count(8) > 0 and ccR.Pet.Distance("target") < 8 then vTalentCount = vTalentCount + 1 if ccR.Spell.CooldownTime(KILL_COMMAND) > 1.5 then vOnCD = vOnCD + 1 end end
				if vOnCD >= vTalentCount then ccR.Cast.Attack(ARCANE_SHOT) end
			end
			if ccR.Player.Has.Talent(FOCUSING_SHOT) then if ccR.Spell.CanAttack(FOCUSING_SHOT) and not ccR.Player.Is.Moving() then ccR.Cast.Attack(FOCUSING_SHOT) end else if ccR.Spell.CanAttack(COBRA_SHOT) then ccR.Cast.Attack(COBRA_SHOT) end end
		end
	end
end